﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FastLibrary.RSS;

namespace CursoUNICEUB
{
    public partial class AllBlogs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
     

        #region ListaBlogs
        private void ListaBlogs()
        {
            if (this.ddlRSS.SelectedItem.Value != "0")
            {
                this.DataList1.DataSource = RSSReader.GetRSSList(this.ddlRSS.SelectedItem.Value, 5);
                this.DataList1.DataBind();

                this.hlkVejaMais.NavigateUrl = this.ddlRSS.SelectedValue;
                this.hlkVejaMais.Visible = true;
            }
        }
        #endregion

        protected void ddlRSS_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //Chamando o metodo ListaBlogs
                ListaBlogs();
            }
            catch (Exception ex)
            {
                Response.Write("Erro: " + ex.Message);
            }
        }
    }
}